<!DOCTYPE html>
<html>
<head>
  <title>管理员信息 - {$sys_config['site_name']}</title>
  {include file="public/head" /}
  <!-- Select2 -->
  <link rel="stylesheet" href="__STATIC__/lte/bower_components/select2/dist/css/select2.min.css">
  <link rel="stylesheet" href="__STATIC__/lte/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="__STATIC__/lte/dist/css/AdminLTE.min.css">
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

  {include file="public/nav" /}
  {include file="public/menu" /}

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
       <h1>
        管理员管理
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制台</a></li>
        <li>管理员</li>
        <li class="active">新增管理员</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">
      <div class="row" >
        <div class="col-xs-12">
          <form id="adminForm" action="{:url('Hospital/doSave')}" class="form-horizontal">
          <div class="box"  style="margin-bottom: 0px;">
            <div class="box-header with-border">
              <h3 class="box-title">账号基本信息</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
              <input type="hidden" name="admin_id" value="{$admin.admin_id}">
              <div class="box-body">
                <div class="form-group">
                  <label for="admin_name" class="col-sm-2 control-label">管理员账号</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="admin_name" value="{$admin.admin_name}">
                  </div>
                </div>
                  <div class="form-group">
                    <label for="admin_password" class="col-sm-2 control-label">管理员密码</label>
                    <div class="col-sm-10">
                      <input type="password" class="form-control" name="admin_password" value="">
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="re_admin_password" class="col-sm-2 control-label">确认密码</label>
                    <div class="col-sm-10">
                      <input type="password" class="form-control" name="re_admin_password" value="">
                    </div>
                  </div>
                <div class="form-group">
                  <label for="realname" class="col-sm-2 control-label">管理员姓名</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="realname" value="{$admin.realname}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="Mobile" class="col-sm-2 control-label">手机号码</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="mobile" value="{$admin.mobile}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="email" class="col-sm-2 control-label">邮箱</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="email" value="{$admin.email}">
                  </div>
                </div>
                <div class="form-group">
                  <label for="role" class="col-sm-2 control-label">角色组</label>
                  <div class="col-sm-10">
                    {volist name="group" id="vo"}
                      <div class="col-xs-4"><input type="checkbox" {in name="key" value="$check_group"}checked{/in} name="group[]" value="{$key}" /> {$vo}</div>
                    {/volist}
                  </div>
                </div>
              </div>
            <!-- /.box-body -->
            <div class="box-footer">
              <div class="col-sm-3" style=" margin-left: 20%;">
                <button type="button" class="btn btn-block btn-primary" id="postSubmit">提交保存</button>
              </div>
            </div>
          </div>
        </form>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  {include file="public/foot" /}
</div>
<!-- ./wrapper -->
{include file="public/js" /}
<script type="text/javascript">
  //根据需要填写需要的模块
layui.use('layer', function(){
  $('#postSubmit').click(function () {
    $.post("{:url('AdminUser/saveAdmin')}", $('#adminForm').serialize(),function(res){
              if (res.status==1){
                layer.msg(res.msg,{time:2000},function(index, layero){
                  location.href="{:url('AdminUser/index')}";
                });
                return false;
              }else{
                layer.msg(res.msg,{time:2000});
                return false;
              }
         }, "json");
  });
});
</script>
</body>
</html>